#+_+ coding:utf-8 +_+


import md5
import config


__author__ = 'cz'


def calculate(args):
    arg_list = args.items()
    arg_list.sort()
    sig_ctnt = ""
    split = ""
    for k,v in arg_list:
        sig_ctnt += split+str(k)+"="+str(v)
        split = "&"
    sig_ctnt += "&secret_key="+config.secret_key
    sig_str = md5.new(sig_ctnt).hexdigest()
    return sig_str

